
#include<iostream>
using namespace std;
#include<cmath>

#include"library.h"

double f(double x){
	return x*(x-1)*(x-2)*(x-3);
}

int main(){

	double x, y;
	x = findmin(f, 0, 0.1, 1E-6);
	cout<<"one minimum is y="<<f(x)<<" at x="<<x<<endl;
	x = findmin(f, 2, 2.1, 1E-6);
	cout<<"one minimum is y="<<f(x)<<" at x="<<x<<endl;
	return 0;
}
